#include <stdio.h>
#include <malloc.h>
int* selfDividingNumbers(int left, int right, int* returnSize)
{
    int* ret = (int*)malloc(sizeof(int) * (right - left + 1));
    *returnSize = 0;
    int flag = 0, a = 0, tmp = 0;
    for (int i = left; i <= right; i++) {
        flag = 0;
        tmp = i;
        while (tmp > 0) {
            a = tmp % 10;
            if (a == 0 || i % a != 0)
            {
                flag = 1;
                break;
            }
            tmp /= 10;
        }
        if (flag == 0) {
            ret[(*returnSize)++] = i;
        }
    }
    return ret;
}